package com.wtgroup.demo.mianshi.设计模式.单例;

/**
 * @author dafei
 * @version 0.1
 * @date 2020/6/12 10:48
 */
public class 懒汉3_枚举 {
    public static void main(String[] args) {
        SingletonLh3.INSTANCE.sayOk();
    }
}

enum SingletonLh3 {
    // 枚举天然就是单例的
    INSTANCE;

    public void sayOk() {
        System.out.println("ok~");
    }
}
